package org.heng.commons.Exception;

import org.heng.commons.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(RuntimeException.class)
    public Result<String> handler(Exception e) {
        return new Result<String>().setMsg(e.getMessage());
    }
}
